package com.ruoyi.mall.service.impl;

import java.util.List;

import com.ruoyi.mall.entity.MallCategoryProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mall.mapper.MallCategoryPropertyMapper;

import com.ruoyi.mall.service.IMallCategoryPropertyService;
import com.ruoyi.common.core.text.Convert;

/**
 * 分类属性中间Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-05-21
 */
@Service
public class MallCategoryPropertyServiceImpl implements IMallCategoryPropertyService 
{
    @Autowired
    private MallCategoryPropertyMapper mallCategoryPropertyMapper;

    /**
     * 查询分类属性中间
     * 
     * @param categoryPropertyId 分类属性中间ID
     * @return 分类属性中间
     */
    @Override
    public MallCategoryProperty selectMallCategoryPropertyById(Long categoryPropertyId)
    {
        return mallCategoryPropertyMapper.selectMallCategoryPropertyById(categoryPropertyId);
    }

    /**
     * 查询分类属性中间列表
     * 
     * @param mallCategoryProperty 分类属性中间
     * @return 分类属性中间
     */
    @Override
    public List<MallCategoryProperty> selectMallCategoryPropertyList(MallCategoryProperty mallCategoryProperty)
    {
        return mallCategoryPropertyMapper.selectMallCategoryPropertyList(mallCategoryProperty);
    }

    /**
     * 新增分类属性中间
     * 
     * @param mallCategoryProperty 分类属性中间
     * @return 结果
     */
    @Override
    public int insertMallCategoryProperty(MallCategoryProperty mallCategoryProperty)
    {
        return mallCategoryPropertyMapper.insertMallCategoryProperty(mallCategoryProperty);
    }

    /**
     * 修改分类属性中间
     * 
     * @param mallCategoryProperty 分类属性中间
     * @return 结果
     */
    @Override
    public int updateMallCategoryProperty(MallCategoryProperty mallCategoryProperty)
    {
        return mallCategoryPropertyMapper.updateMallCategoryProperty(mallCategoryProperty);
    }

    /**
     * 删除分类属性中间对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteMallCategoryPropertyByIds(String ids)
    {
        return mallCategoryPropertyMapper.deleteMallCategoryPropertyByIds(Convert.toStrArray(ids));
    }
    /**
     * 删除分类对应的属性
     * @param categoryId
     * @return
     */
    @Override
    public int deleteMallCategoryPropertyByCategoryId(Long categoryId) {
        return mallCategoryPropertyMapper.deleteMallCategoryPropertyByCategoryId(categoryId);
    }

    /**
     * 删除分类属性中间信息
     * 
     * @param categoryPropertyId 分类属性中间ID
     * @return 结果
     */
    @Override
    public int deleteMallCategoryPropertyById(Long categoryPropertyId)
    {
        return mallCategoryPropertyMapper.deleteMallCategoryPropertyById(categoryPropertyId);
    }
}
